# -*- coding: UTF-8 -*-
"""
@Project ：swift-forge-engine 
@File    ：login_log_schema
@IDE     ：PyCharm 
@Author  ：Tony
@Date    ：2025/2/21 9:56 
@Des     ：
"""
from datetime import datetime

from pydantic import ConfigDict

from App.common.schema import SchemaBase


class LoginLogSchemaBase(SchemaBase):
    model_config = ConfigDict(from_attributes=True)

    user_id: int
    username: str
    status: int
    ip: str
    country: str | None
    region: str | None
    city: str | None
    user_agent: str
    browser: str | None
    os: str | None
    device: str | None
    message: str
    login_time: datetime


class CreateLoginLogParam(LoginLogSchemaBase):
    pass


class UpdateLoginLogParam(LoginLogSchemaBase):
    pass


class GetLoginLogListDetails(LoginLogSchemaBase):
    id: int
    created_time: datetime
